package com.raler.proyar.bl.interfaces;

import java.io.Serializable;
import java.util.List;

import com.google.common.base.Function;
import com.raler.proyar.bl.exception.GeneralBusinessException;
import com.raler.proyar.il.model.GeneralDomainObject;
import com.raler.proyar.pl.dto.AbstractDto;

public interface GeneralBS<E extends GeneralDomainObject> {


	E insert( E entity ) throws GeneralBusinessException;

	E update( E entity ) throws GeneralBusinessException;

	<T extends AbstractDto> E update( T dto, Function<T, E> conversor ) throws GeneralBusinessException;

	<T extends AbstractDto> List<E> update( List<T> dtos, Function<T, E> conversor ) throws GeneralBusinessException;

	void remove( Serializable id ) throws GeneralBusinessException;

	E findById( Serializable id ) throws GeneralBusinessException;

	List<E> findAll() throws GeneralBusinessException;

}
